import request from '@/utils/request'

export function getServiceRecordList(params) {
  return request({
    url: '/serviceRecord/list',
    method: 'get',
    params
  })
}

export function getServiceRecordDetail(id) {
  return request({
    url: `/serviceRecord/${id}`,
    method: 'get'
  })
}

export function addServiceRecord(data, employeeIds) {
  return request({
    url: '/serviceRecord',
    method: 'post',
    params: { employeeIds: employeeIds.join(',') },
    data
  })
}

export function updateServiceRecord(data) {
  return request({
    url: '/serviceRecord',
    method: 'put',
    data
  })
}

export function deleteServiceRecord(id) {
  return request({
    url: `/serviceRecord/${id}`,
    method: 'delete'
  })
}
